<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
        /**
        * 医保对照弹出框
         * @param url
         */
        function priceMedical(url){
            layerIndex =layer.open({
                type: 2,
                title:'医保数据对照',
                area: ['60%', '70%'],
                fixed: false, //不固定
                maxmin: true,
                content: url,
                btn: ['确定', '取消'],
                yes:function(index,layero){
                   $(layero).find("iframe")[0].contentWindow.saveVsMedical();
                } ,no:function(index){
                    layer.close(index);
                }
            });
        }
        /**
        *   关闭弹出框
         */
        function closeLayer(){
            layer.close(layerIndex);
            $("#searchForm").submit();
        }
</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/med/hisVsMedical/index')">医保数据对照</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                            	<form:form id="searchForm" modelAttribute="hisVsMedical"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/med/hisVsMedical/index');" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <label>对照状态：</label><form:select id="status" path="status" class="form-control" >
                                        <form:option value="0" label="全部"/><form:option value="1" label="未对照"/><form:option value="2" label="已对照"/></form:select>

                                    &nbsp;&nbsp;<label>项目类别 ：</label>
                                    <form:select path="itemClassHis" class="form-control">
                                        <form:option value="" label=""/>
                                        <form:options items="${fns:getDictList('BILL_ITEM_CLASS_DICT')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                                    </form:select>
                                    &nbsp;&nbsp;<label>项目搜索：</label><form:input path="inputCode" htmlEscape="false" maxlength="50" class="form-control" />
                                    &nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                </form:form>
                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered mg-t datatable">
                            <thead>
                                <tr>
                                    <th>项目类别</th>
                                    <th>项目名称</th>
                                    <th>项目代码</th>
                                    <th>项目规格</th>
                                    <th>项目单位</th>
                                    <th>医保项目名称</th>
                                    <th>医保项目代码</th>
                                    <th>医保项目规格</th>
                                    <th>医保项目单位</th>
                                    <th>剂型</th>
                                    <th>医保类型</th>
                                    <th>录入人员</th>
                                    <th>录入时间</th>
                                    <th>修改人员</th>
                                    <th>修改时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="hisVsMedical" varStatus="index">
                                <tr>
                                    <td> ${fns:getDictLabel(hisVsMedical.itemClassHis, 'BILL_ITEM_CLASS_DICT', '')}</td>
                                    <td>${hisVsMedical.itemNameHis}</td>
                                    <td>${hisVsMedical.itemCodeHis}</td>
                                    <td>${hisVsMedical.itemSpecHis}</td>
                                    <td> ${fns:getDictLabel(hisVsMedical.itemUnits, 'SPEC_UNIT', '')}</td>
                                    <td>${hisVsMedical.itemNameMed}</td>
                                    <td>${hisVsMedical.itemCodeMed}</td>
                                    <td>${hisVsMedical.specMed}</td>
                                    <td>${hisVsMedical.unitsMed}</td>
                                    <td>${hisVsMedical.drugForm}</td>
                                    <td>${hisVsMedical.remarks}</td>
                                    <td>${hisVsMedical.createBy.name}</td>
                                    <td><fmt:formatDate value="${hisVsMedical.createDate}" type="both"/> </td>
                                    <td>${hisVsMedical.updateBy.name}</td>
                                    <td><fmt:formatDate value="${hisVsMedical.updateDate}" type="both"/> </td>
                                    <td>
                                        <c:choose>
                                            <c:when test="${hisVsMedical.hisVsMedicalId==''|| hisVsMedical.hisVsMedicalId==null}">
                                                <a href="#" onclick="priceMedical('${ctx}/med/hisVsMedical/form?id=${hisVsMedical.priceId}'+'&type=0')" class="btn btn-success btn-xs">对 照</a>
                                            </c:when>
                                            <c:otherwise>
                                                <a href="#" onclick="priceMedical('${ctx}/med/hisVsMedical/form?id=${hisVsMedical.id}'+'&type=1')" class="btn btn-success btn-xs">修改</a>
                                                <a href="#"  class="applyBt btn btn-danger btn-xs" onclick="confirmExtend('确认要取消该医保数据与his数据对照吗？',function(){delLoadForm('${ctx}/med/hisVsMedical/delete?id=${hisVsMedical.id}','searchForm')})">取消</a>
                                            </c:otherwise>
                                        </c:choose>
                                    </td>
                                </tr>
                            </c:forEach>
                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
                <div class="col-md-12 " id="priceMedicalForm" style="display: none">
                    <section class="panel panel-primary no-b">
                        <div class="list-group" id="reg">
                            <div class="col-lg-12">
                                <form:form id="inputForm" data-parsley-validate="" modelAttribute="hisVsMedical" onsubmit="return formSaveLoad('mainCenterDiv','inputForm','${ctx}/med/hisVsMedical/save','${ctx}/med/hisVsMedical/index');" method="post" class="form-horizontal">
                                    <form:hidden path="id"/>
                                    <form:hidden path="priceId"/><%--价表id--%>
                                    <form:hidden path="medicalId" value="${HisVsMedical.medicalId}"/><%--价表id--%>
                                    <form:hidden path="medicalInsuranceType"/><%--医保类别--%>
                                    <form:hidden path="province"/><%--省份--%>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">医保项目名称：</label>
                                        <div class="col-sm-4">
                                            <form:input path="itemNameMed" htmlEscape="false" class="form-control" maxlength="100" disabled="true"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">医保项目类别：</label>
                                        <div class="col-sm-4">
                                            <form:input path="itemClassMed" htmlEscape="false" class="form-control"  maxlength="10" disabled="true" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">医保项目代码：</label>
                                        <div class="col-sm-4">
                                            <form:input path="itemCodeMed" htmlEscape="false" class="form-control" disabled="true" maxlength="50" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">医保项目规格：</label>
                                        <div class="col-sm-4">
                                            <form:input path="specMed" htmlEscape="false" class="form-control" disabled="true" maxlength="50" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">医保项目单位：</label>
                                        <div class="col-sm-4">
                                            <form:input path="unitsMed" htmlEscape="false" class="form-control" disabled="true" maxlength="50" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">费别：</label>
                                        <div class="col-sm-4">
                                            <form:input path="remarks" htmlEscape="false" class="form-control" disabled="true" maxlength="50" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">项目名称：</label>
                                        <div class="col-sm-4">
                                            <form:input path="itemNameHis" htmlEscape="false" class="form-control"  maxlength="100" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">项目类别：</label>
                                        <div class="col-sm-4">
                                            <form:input path="itemClassHis" htmlEscape="false" class="form-control" disabled="true"  maxlength="10" />
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">项目代码：</label>
                                        <div class="col-sm-4">
                                            <form:input path="itemCodeHis" htmlEscape="false" class="form-control" disabled="true" maxlength="50" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">项目规格：</label>
                                        <div class="col-sm-4">
                                            <form:input path="itemSpecHis" htmlEscape="false" class="form-control" disabled="true" maxlength="50" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">项目单位：</label>
                                        <div class="col-sm-4">
                                            <form:input path="itemUnits" htmlEscape="false" class="form-control" disabled="true"  maxlength="20" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">费别：</label>
                                        <div class="col-sm-4">
                                            <form:input path="remarksHis" htmlEscape="false" class="form-control" disabled="true" maxlength="20" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-offset-2 col-sm-10">
                                            <input id="btnSubmitSave" class="btn btn-primary" type="submit" value="保 存">&nbsp;
                                            <input id="btnCancel" class="btn" type="button" value="返 回" onclick="loadDiv('mainCenterDiv','${ctx}/med/hisVsMedical/index')">
                                        </div>
                                    </div>
                                </form:form>
                            </div>
                        </div>
                    </section>
                </div>
            </section>
        </div>
</div>

